using AdvancedInspector;
using I2.Loc;
using UnityEngine;

[AdvancedInspector(true)]
public class ChestBonusItemData
{
	public string id;

	public int count;

	public int timeLife;

	public string GetTimeLabel()
	{
		int num = timeLife / 24;
		if (num > 0)
		{
			string arg = ScriptLocalization.Get("Lobby_ShopCoins/day");
			return string.Format("{0}{1}", num, arg);
		}
		string arg2 = ScriptLocalization.Get("Lobby_ShopCoins/hour");
		return string.Format("{0}{1}.", num, arg2);
	}

	public string GetItemCountOrTime()
	{
		int num = timeLife / 24;
		return (timeLife != -1) ? GetTimeLabel() : ((count > 1) ? count.ToString() : string.Empty);
	}

	public Texture GetTexture()
	{
		if (BCWDebug.isDebugBuild)
		{
			BCWDebug.Log("GetTexture Chest id: " + id);
		}
		MarketController.Instance.GetProductTexture(id);
		return null;
	}

	public string GetNameItem()
	{
		Product product = MarketController.Instance.GetProduct(id);
		if (product != null)
		{
			return ScriptLocalization.Get("Market/" + product.id + "_info");
		}
		return null;
	}
}
